import request from "../../utils/request";


/**
 * 获取供应商订单详情
 * @param {*} obj
 */
export const getSupplierOrderDetail = (obj) => {
  return request({
    url: "api/wechat/GetSupplierOrderDetail",
    data: obj,
    method: "GET",
  });
};


/**
 * 批量发货/取消
 * @param {*} obj
 */
export const multipleSupplierSend = (obj) => {
  return request({
    url: "api/wechat/MultipleSupplierSend",
    data: obj,
    method: "post",
  });
};

/**
 *
 * @param {*} obj
 */
export const getStatistics = (obj) => {
  return request({
    url: "api/wechat/GetSupplierStatistics",
    data: obj,
    method: "get",
  });
};

/**
 * 确认收货
 * @param {*} obj
 */
export const confirmReceive = (obj) => {
  return request({
    url: "api/wechat/Supplier_ConfirmReceive",
    data: obj,
    method: "post",
  });
};

/**
 * 拒绝确认收货
 * @param {*} obj
 */
export const refuseReceive = (obj) => {
  return request({
    url: "api/wechat/Supplier_RefuseReceive",
    data: obj,
    method: "post",
  });
};


//获取供应商所有统计数据
export const GetSupplierOrders = (obj) => {
  return request({
    url: 'api/WeChat/GetSupplierOrders',
    method: 'GET',
    params: obj
  })
}

/**
 * 供应商-接单
 * @param {*} obj
 */
export const supplierAcceptOrder = (obj) => {
  return request({
    url: "api/wechat/supplier_AcceptOrder",
    data: obj,
    method: "post",
  });
};


/**
 * 获取供应商商品
 * @param {*} obj
 */
export const GetSupplierGoods = (obj) => {
  return request({
    url: "api/wechat/GetSupplierGoods",
    data: obj,
    method: "GET",
  });
};

/**
 * 获取七日订单量
 * @param {*} obj
 * @returns
 */
export const GetOrderStatisticsByDate = async (obj) => {
  var result= await request({
    url: "api/wechat/Supplier_GetOrderStatisticsByDate",
    data: obj,
    params: "get",
  });
  return result;
};


/**
 * 获取供应商接单
 * @param {*} obj 
 * @returns 
 */
export const getSupplierOrders = (obj) => {
  return request({
    url: 'api/WeChat/GetSupplierOrders',
    method: 'get',
    params: obj
  })
}

/**
 * 供应商确定接单
 * @param {*} obj 
 * @returns 
 */
export const acceptOrder = (obj) => {
  return request({
    url: 'api/WeChat/Supplier_AcceptOrder',
    method: 'post',
    data: obj
  })
}

/**
 * 供应商取消接单
 * @param {*} obj 
 * @returns 
 */
export const cancelOrders = (obj) => {
  return request({
    url: 'api/WeChat/Supplier_CancelOrders',
    method: 'post',
    data: obj
  })
}

/**
 * 供应商-发货、取消发货
 * @param {*} obj
 */
export const supplierSend = (obj) => {
  return request({
    url: "api/wechat/supplierSend",
    data: obj,
    method: "post",
  });
};

/**
* 供应商取消订单
* @param {*} obj
*/
export const supplierCancelOrders = (obj) => {
  return request({
    url: "api/wechat/Supplier_CancelOrders",
    data: obj,
    method: "post",
  });
};

/**
 * 获取七日订单量
 * @param {*} obj
 * @returns
 */
export const getOrderStatisticsByDate = async (obj) => {
  var result = await request({
    url: "api/wechat/Supplier_GetOrderStatisticsByDate",
    params: obj,
    method: "get",
  });
  return result;
};

/**
 * 获取商品类别
 * @param {*} obj 
 * @returns 
 */
export const getGoodsTypes = (obj) => {
  return request({
    url: "api/wechat/Supplier_GetGoodsTypes",
    params: obj,
    method: "GET",
  });
};

/**
 * 获取供应商的所有类别和类别下商品
 * @returns
 */
export const getTypesAndGoods = (obj) => {
  return request({
    url: "api/wechat/Supplier_GetTypesAndGoods",
    params: obj,
    method: "GET",
  });
};